% SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
\ifdefined\Vanilla\else
\documentclass{memoir}
\fi

% ------------------------------
% Unknown commands/env for po4a
% ------------------------------
% po4a: environment Verbatim
% po4a: verbatim environment Verbatim
% po4a: environment minted []
% po4a: environment listing []
% po4a: command -hyperref []{_}
% po4a: command +hypertarget {}{_}
% po4a: command -href {}{_}
% po4a: command -url {}
% po4a: command -pagecolor {}
% po4a: command *colorbox {}{_}

\usepackage[margin=1in]{geometry}
\usepackage[T1]{fontenc}
\usepackage{mathpazo} % Palatino
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usepackage{mdframed}
\usepackage[outputdir=.]{minted}
\usepackage{hyperref}
\usepackage[all]{hypcap}
\usepackage[inkscapearea=page]{svg}

% po4a: command hypersetup {}
\hypersetup{
    unicode=true,
    colorlinks=true
}

% Add numbering for subsubsection
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}

% Import localised keywords
\input{keywords}

% -------------------
% Alert environments
% -------------------

% po4a: environment amalert--tip []{}
% po4a: environment amalert--warning []{}
% po4a: environment amalert--danger []{}
% po4a: environment mdframed []{_}
\newenvironment{amalert--tip}
{\mdframed[linecolor={black},backgroundcolor=white,linewidth=3pt,topline=false,rightline=false,bottomline=false]}
{\endmdframed}

\newenvironment{amalert--warning}
{\mdframed[linecolor={Dandelion},backgroundcolor=white,linewidth=3pt,topline=false,rightline=false,bottomline=false]}
{\endmdframed}

\newenvironment{amalert--danger}
{\mdframed[linecolor={BrickRed},backgroundcolor=white,linewidth=3pt,topline=false,rightline=false,bottomline=false]}
{\endmdframed}

% po4a: environment tip [_]
\newenvironment{tip}[1]
{%
    \begin{amalert--tip}
    \noindent
    \textbf{\textit{#1\KeywordEndOfKeyWordInAlert}}
    }%
    {
    \end{amalert--tip}
}

% po4a: environment warning [_]
\newenvironment{warning}[1]
{
    \begin{amalert--warning}
    \noindent
    \textbf{\textit{#1\KeywordEndOfKeyWordInAlert}}
    }%
    {
    \end{amalert--warning}
}

% po4a: environment danger [_]
\newenvironment{danger}[1]
{
    \begin{amalert--danger}
    \noindent
    \textbf{\textit{#1\KeywordEndOfKeyWordInAlert}}
    }%
    {
    \end{amalert--danger}
}

% --------------------
% Reference overrides (useful for localization)
% --------------------
\newcommand{\listingrefname}{Listing}
% po4a: command Lref {_}
\newcommand{\Lref}[1]{\listingrefname~\ref{#1}}

% ----------------------
% See also environments
% ----------------------
% po4a: command seealso-inline {_}
\newenvironment{seealso-inline}{}{}
\newcommand{\seealsoinline}[1]{
\begin{seealso-inline}
\noindent\textit{\KeywordSeeAlso~{#1}}
\end{seealso-inline}
}
% po4a: environment amseealso
\newenvironment{amseealso}{
    \begin{seealso}
        \itshape\KeywordSeeAlso
        \begin{itemize}
        }
        {
        \end{itemize}
    \end{seealso}
}

% Special case for \includesvg for Pandoc
\ifdefined\Vanilla\else
    \renewcommand{\includesvg}{\includegraphics}
\fi

% \Cref, \Sref fix for Pandoc
\ifdefined\Vanilla\else
\renewcommand{\Cref}{\KeywordChapter~\ref}
\fi
\ifdefined\Vanilla\else
\renewcommand{\Sref}{§\ref}
\fi

% -------------------
% Colours used in AM
% -------------------
% The format used here is parsed by Regex and should not be altered.
\definecolor{AMRed}{HTML}{FF0000}
\definecolor{AMDarkRed}{HTML}{790D0D}
\definecolor{AMLightRed}{HTML}{FF8A80}
\definecolor{AMVeryDarkRed}{HTML}{4F1C14}
\definecolor{AMVividOrange}{HTML}{FF8017}
\ifdefined\Vanilla\else
    \definecolor{uninstalled-day}{HTML}{FF0000B3}
    \definecolor{uninstalled-night}{HTML}{790D0D}
    \definecolor{disabled-day}{HTML}{FF8A80}
    \definecolor{disabled-night}{HTML}{4F1C14BF}
    \definecolor{force-stopped}{HTML}{09868B}
    \definecolor{tracker-day}{HTML}{FF8017}
    \definecolor{tracker-night}{HTML}{FF801780}
    % For compatibility only
    \definecolor{AMVeryDarkOrange}{HTML}{FF801780}
\fi
\ifdefined\Vanilla
    % We have to define Vanilla colour later because Pandoc only looks at the first colour
    \definecolor{uninstalled-day}{HTML}{FF0000}
    \definecolor{uninstalled-night}{HTML}{790D0D}
    \definecolor{disabled-day}{HTML}{FF8A80}
    \definecolor{disabled-night}{HTML}{4F1C14}
    \definecolor{force-stopped}{HTML}{09868B}
    \definecolor{tracker-day}{HTML}{FF8017}
    \definecolor{tracker-night}{HTML}{FF8017}
    % For compatibility only
    \definecolor{AMVeryDarkOrange}{HTML}{FF8017}
\fi
\definecolor{AMSoftMagenta}{HTML}{EA80FC}
\definecolor{AMVeryDarkViolet}{HTML}{431C5D}
\definecolor{AMLightGreyishOrange}{HTML}{FCEED1}
\definecolor{AMDarkBlue}{HTML}{091F36}
\definecolor{AMOrange}{HTML}{E05915}
\definecolor{AMDarkCyan}{HTML}{09868B}
\definecolor{AMGreen}{HTML}{1b8654}
\definecolor{AMYellow}{HTML}{FFFF00}
\definecolor{SunTan}{HTML}{F6D5A8}

% ------------------
% colorbox override
% ------------------
\newcommand{\backgroundcolor}[2]{

}

% META
\title{App Manager}
\author{Muntashir Al-Islam}

% Load variables
\input{transient}

\begin{document}
    \input{titlepage}
    \ifdefined\HCode
    % Don't display table of contents for tex4ht
    \else
        \tableofcontents
    \fi
    \input{intro/main}
    \input{pages/main}
    \input{guide/main}
    \input{faq/main}
    \input{appendices/main}
\end{document}
